home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / packagetool / sample package / htmlsample sources / htmlsample.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  4.7 KB  |  136 lines

  1. /*
  2.     File: HTMLSample.h
  3.     
  4.     Description:
  5.         This file contains constant declarations and exported routine prototypes
  6.     used in the HTMLSample application.
  7.     
  8.     HTMLSample is an application illustrating how to use the new
  9.     HTMLRenderingLib services found in Mac OS 9. HTMLRenderingLib
  10.     is Apple's light-weight HTML rendering engine capable of
  11.     displaying HTML files.
  12.  
  13.     Copyright:
  14.         © Copyright 1999 Apple Computer, Inc. All rights reserved.
  15.     
  16.     Disclaimer:
  17.         IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
  18.         ("Apple") in consideration of your agreement to the following terms, and your
  19.         use, installation, modification or redistribution of this Apple software
  20.         constitutes acceptance of these terms.  If you do not agree with these terms,
  21.         please do not use, install, modify or redistribute this Apple software.
  22.  
  23.         In consideration of your agreement to abide by the following terms, and subject
  24.         to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
  25.         copyrights in this original Apple software (the "Apple Software"), to use,
  26.         reproduce, modify and redistribute the Apple Software, with or without
  27.         modifications, in source and/or binary forms; provided that if you redistribute
  28.         the Apple Software in its entirety and without modifications, you must retain
  29.         this notice and the following text and disclaimers in all such redistributions of
  30.         the Apple Software.  Neither the name, trademarks, service marks or logos of
  31.         Apple Computer, Inc. may be used to endorse or promote products derived from the
  32.         Apple Software without specific prior written permission from Apple.  Except as
  33.         expressly stated in this notice, no other rights or licenses, express or implied,
  34.         are granted by Apple herein, including but not limited to any patent rights that
  35.         may be infringed by your derivative works or by other works in which the Apple
  36.         Software may be incorporated.
  37.  
  38.         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
  39.         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
  40.         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  41.         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
  42.         COMBINATION WITH YOUR PRODUCTS.
  43.  
  44.         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
  45.         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  46.         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  47.         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
  48.         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
  49.         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
  50.         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  51.  
  52.     Change History (most recent first):
  53.         Wed, Dec 22, 1999 -- created
  54. */
  55.  
  56.  
  57. #ifndef __HTMLSAMPLE__
  58. #define __HTMLSAMPLE__
  59.  
  60. #include <MacTypes.h>
  61. #include <Events.h>
  62.  
  63.     /* the resource ID of the main menu bar list. */
  64. enum {
  65.     kMenuBarID = 128
  66. };
  67.  
  68.     /* the resource id of the main string list */
  69. enum {
  70.     kMainStringList = 128,
  71.     kNavMessageString = 1
  72. };
  73.  
  74.     /* constants referring to the apple menu */
  75. enum {
  76.     mApple = 128,
  77.     iAbout = 1,
  78.     iFirstAppleItem = 3
  79. };
  80.  
  81.     /* constants referring to the file menu */
  82. enum {
  83.     mFile = 129,
  84.     iOpen = 1,
  85.     iQuit = 3
  86. };
  87.  
  88.     /* constants referring to the edit menu */
  89. enum {
  90.     mEdit = 130,
  91.     iUndo = 1,
  92.     iCut = 3,
  93.     iCopy = 4,
  94.     iPaste = 5,
  95.     iClear = 6
  96. };
  97.  
  98.     /* constants referring to the go menu */
  99. enum {
  100.     mGo = 131,
  101.     iBack = 1,
  102.     iForward = 2,
  103.     iHome = 3,
  104.     iGoSep = 4
  105. };
  106.  
  107.     /* resource ID numbers for alerts that are called
  108.     to report different error conditions. */
  109. enum {
  110.     kOpenFileErrorAlert = 128,
  111.     kOpenApplicationErrorAlert = 130,
  112.     kNoRenderingLibErrorAlert = 131,
  113.     kNoAboutBoxErrorAlert = 132
  114. };
  115.  
  116.     /* resource ID numbers for resources containing
  117.     application relative links to files displayed by the
  118.     application.  These resources contain c-style strings. */
  119. enum {
  120.     kCStyleStringResourceType = 'CSTR',
  121.     kDefaultPageURLString = 128,
  122.     kErrorPageURLString = 129
  123. };
  124.  
  125. /* ParamAlert is a general alert handling routine.  If Apple events exist, then it
  126.     calls AEInteractWithUser to ensure the application is in the forground, and then
  127.     it displays an alert after passing the s1 and s2 parameters to ParamText. */
  128. short ParamAlert(short alertID, StringPtr s1, StringPtr s2);
  129.  
  130. /* HandleEvent is the main event handling routine for the
  131.     application.  ev points to an event record returned by
  132.     WaitNextEvent. */
  133. void HandleEvent(EventRecord *ev);
  134.  
  135. #endif
  136.